const service = require('../../utils/service.js');
const api = require('../../utils/util.js');
Page({
    data: {
        list: '',
		order_id: '',
		msgList: [],
		is_flow: false
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
    	this.setData({
    		order_id: options.order_id
    	});
        this.init();
    },
	init: function(){
		this.getList();
	},
	//--获取数据
	getList: function(){
		let self = this;
		api.ajax(service.url('buyViewExpress'),{
			order_id: self.data.order_id
		},function (res) {
			console.log("orderFlow: "+JSON.stringify(res));
			if(res.code == 0){
				if(typeof res.data.content == 'object' && Array.isArray(res.data.content.data)){
					self.setData({
						msgList: res.data.content.data,
						is_flow: true
					});
				}
				self.setData({
		    		list: res.data
		    	});
			}
		});
	},
	shopFlowCopy: function(et){
		let self = this;
		wx.setClipboardData({
			data: self.data.list.express_sn
		});
	}
})